﻿<Page x:Class="WpfTestSvgSample.SvgPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
    Title="SvgPage">
    <DockPanel LastChildFill="True">
        <ToolBar DockPanel.Dock="Top" Height="32">
            <ToolBar.Resources>
                <Style TargetType="{x:Type Image}">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type ButtonBase}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
                            <Setter Property="Opacity" Value="0.30" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </ToolBar.Resources>
            <Button Click="OnOpenFileClick">
                <Image Source="Images/Open.png" Height="16"/>
            </Button>
            <Button Click="OnSaveFileClick">
                <Image Source="Images/Save.png" Height="16"/>
            </Button>
            <Separator/>
            <Button Command="Cut">
                <Image Source="Images/Cut.png" Height="16"/>
            </Button>
            <Button Command="Copy">
                <Image Source="Images/Copy.png" Height="16"/>
            </Button>
            <Button Command="Paste">
                <Image Source="Images/Paste.png" Height="16"/>
            </Button>
            <Button Command="Delete">
                <Image Source="Images/Delete.png" Height="16"/>
            </Button>
            <Separator/>
            <Button Command="Undo">
                <Image Source="Images/Undo.png" Height="16"/>
            </Button>
            <Button Command="Redo">
                <Image Source="Images/Redo.png" Height="16"/>
            </Button>
            <Separator/>
            <CheckBox IsChecked="{Binding ElementName=textEditor,Path=WordWrap}">
                <Image Source="Images/WordWrap.png" Height="16"/>
            </CheckBox>
            <CheckBox IsChecked="{Binding ElementName=textEditor,Path=ShowLineNumbers}">
                <Image Source="Images/PageNumber.png" Height="16"/>
            </CheckBox>
            <CheckBox IsChecked="{Binding ElementName=textEditor,Path=Options.ShowEndOfLine}">
                <TextBlock Width="16" TextAlignment="Center">¶</TextBlock>
            </CheckBox>
            <ComboBox Name="highlightingComboBox" Width="100"
				SelectedItem="{Binding SyntaxHighlighting, ElementName=textEditor}"
				ItemsSource="{Binding Source={x:Static avalonEdit:HighlightingManager.Instance}, Path=HighlightingDefinitions}"
				SelectionChanged="OnHighlightingSelectionChanged"/>
            <Separator/>
            <TextBox Name="searchTextBox" Width="200" KeyUp="OnSearchTextBoxKeyUp" />
            <Button Click="OnSearchTextClick">
                <Image Source="Images/Find.png" Height="16"/>
            </Button>
            <Separator/>
            <Button Command="Print">
                <Image Source="Images/Print.png" Height="16"/>
            </Button>
            <Button Command="PrintPreview">
                <Image Source="Images/PrintPreview.png" Height="16"/>
            </Button>
        </ToolBar>

        <avalonEdit:TextEditor Name="textEditor" FontFamily="Consolas" FontSize="10pt"/>
    </DockPanel>
</Page>
